# 3-4 匹配符号
import re

class Stack(object):
    def __init__(self):
        self.items = []  # 空列表

    def push(self, item):
        self.items.append(item)

    def pop(self):
        return self.items.pop()

    def peek(self):
        return self.items[len(self.items) - 1]

    def isEmpty(self):
        return self.items == []

    def size(self):
        return len(self.items)


def matches(symbol, top):
    symbols = "([{"
    tops = ")]}"
    return symbols.index(top) == tops.index(symbol)


def parChecker(symbolString):
    symbolString = re.findall(r"[]()[{}]", symbolString)
    index = 0  # 索引
    s = Stack()  # 栈
    balanced = True
    while index < len(symbolString) and balanced:
        symbol = symbolString[index]
        if symbol in "([{":
            s.push(symbol)
        else:
            if s.isEmpty():
                balanced = False
            else:
                top = s.pop()  # 栈顶部删除 并返回
                if not matches(symbol, top):
                    balanced = False
        index += 1
    if balanced and s.isEmpty():
        return "yes"
    else:
        return "no"


sysmbolString = input()
print(parChecker(sysmbolString))
